import java.util.*;
import java.math.BigInteger;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main5 {
    static Long a = 0L;
    static Long b = 0L;
    static Long c = 0L;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        a = in.nextLong();
        b = in.nextLong();
        c = in.nextLong();
        Long k = in.nextLong();
        Long[] nums = new Long[]{a,b,c};
        fun(nums);

        for(int i = 0;i<k;i++){
            nums[0]++;
            fun(nums);
        }
        System.out.println((a * b * c) % 1000000007);
    }
    public static void fun(Long[] nums){
        Arrays.sort(nums);

        a = nums[0];
        b = nums[1];
        c = nums[2];
    }
}